To use a kTweenTypePathToMatrixRotation tween component, do the following:
Listing 15 shows how to create a kTweenTypePathToMatrixRotation tween.
Listing 15 Creating a kTweenTypePathToMatrixRotation tween container
// kTweenTypePathToMatrixRotation
err = CreateSamplePathTweenContainer( container,
kTweenTypePathToMatrixRotation, 1, false,
duration, X2Fix(0.5), &tweenAtom );
if ( err ) goto bail;
err = QTNewTween( &tween, container, tweenAtom, duration );
if ( err ) goto bail;
for ( tweenTime = 0; tweenTime <= duration; tweenTime++ ) {
MatrixRecord absoluteMatrix;
err = QTDoTween( tween, tweenTime, result, nil, nil, nil );
if ( err ) goto bail;
absoluteMatrix = *(MatrixRecord *)*result;
}
err = QTDisposeTween( tween );
bail:
if ( container ) QTDisposeAtomContainer( container );
if ( result ) DisposeHandle( result );
| Previous | Chapter Contents | Chapter Top | Next |